UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F112qgv3TF+019/YpQ1vyZ7YhZwPywOyJpxyL7ZWp6E=' 
WHERE 
  key_id = 'aeb1e9d9d09bf6399fee7733aa8c46b39eccac4dfff38b797d265b37772daf40' 
  AND (
    token = 'F112qgv3TF+019/YpQ1vyZ7YhZwPywOyJpxyL7ZWp6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030