UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dV2Whz6StQZomY4Swc12+Q8H3CgGIjumYC7pQ0jGJiA=' 
WHERE 
  key_id = 'aa954dc7faed6fb04b33d62c276f0fd455c7d220f80456ed6fa1daac974b29e2' 
  AND (
    token = 'dV2Whz6StQZomY4Swc12+Q8H3CgGIjumYC7pQ0jGJiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025