UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H6X8KgX0PrY9G1Bjm9WDlQAnf2lYt1eGINqdg2JQVRc=' 
WHERE 
  key_id = '6dee79ae096510807dbe53acde0ad0fbe5c95b052cdf3c645c62408631a34009' 
  AND (
    token = 'H6X8KgX0PrY9G1Bjm9WDlQAnf2lYt1eGINqdg2JQVRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030