UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FIeBifzmUi5P1QvK6o2bDoEKAqhvwknZPuxOUuEwb28=' 
WHERE 
  key_id = '004c14467aee98f2db95a1a3c7c3e1ccbe5590c79373a025f0cef5d6e39e8c10' 
  AND (
    token = 'FIeBifzmUi5P1QvK6o2bDoEKAqhvwknZPuxOUuEwb28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056