UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D5k1Kfyk3WtaKzEjyijCvyiFAhKcmkvMf4drhejux90=' 
WHERE 
  key_id = 'e5bb60552175baf07abfb9e3b65390ff2132f223abf1a95dc5b7f23bd6987bea' 
  AND (
    token = 'D5k1Kfyk3WtaKzEjyijCvyiFAhKcmkvMf4drhejux90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033