UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/WFeqVKacY5nrsLqhZp0CeUCf3ilU1qB1eVLn/20wtY=' 
WHERE 
  key_id = '775e89c4ad16bc9b06f2d766a5a4388fe34bbc937527d19b55836af945d05644' 
  AND (
    token = '/WFeqVKacY5nrsLqhZp0CeUCf3ilU1qB1eVLn/20wtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022