UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ttUQctwtMD1espeUax+lOMg3ar6lJMypbX2AhuhLpkY=' 
WHERE 
  key_id = 'eac0294876fda8f7cffa7b2ad179b0dc49c61c7d73332c2c0477d2fa9d5f5418' 
  AND (
    token = 'ttUQctwtMD1espeUax+lOMg3ar6lJMypbX2AhuhLpkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024