UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eS7mS70Dz7JOjQq4NubvhDB/S3XB54JEignFk0a765M=' 
WHERE 
  key_id = 'a9cab878f8f567b1a3e7b920d88aedd1cc4e4635bae42bbd1a90e42820c7f144' 
  AND (
    token = 'eS7mS70Dz7JOjQq4NubvhDB/S3XB54JEignFk0a765M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025