UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZN9dB8W0o9BJyQ74GJJH/DEchdIOHBVml0CfA3IQvkI=' 
WHERE 
  key_id = '9dc9a27b38070e971013cc0bdf429905d724f4afef881a381d8692346f0b0144' 
  AND (
    token = 'ZN9dB8W0o9BJyQ74GJJH/DEchdIOHBVml0CfA3IQvkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029