UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EpKthq0/KFKOmhp1ev2H24X3LQVsqCOXK+1HqLxdPwA=' 
WHERE 
  key_id = 'c72adff2f8b4ba5aad8082f8a93cdd91f9a220cedd2c17d95627466613f2dd2a' 
  AND (
    token = 'EpKthq0/KFKOmhp1ev2H24X3LQVsqCOXK+1HqLxdPwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029