UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fsg5r/rbhzxuWW+Mxzm5uTSRWKGsd3s+5Ha2m2Lu4QA=' 
WHERE 
  key_id = '431eb19c2e1455a0e6a358226242659530ca22c9a2423581b49b781db3aea99c' 
  AND (
    token = 'fsg5r/rbhzxuWW+Mxzm5uTSRWKGsd3s+5Ha2m2Lu4QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016