UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VgR0l7vCw88rNU1or3cdY/IYGJ3D/7E50HgAh8oM/pQ=' 
WHERE 
  key_id = 'df02454c58c6137fe0b5673107f8e548ada47b0983f694f9ceae8f5bd5d0277e' 
  AND (
    token = 'VgR0l7vCw88rNU1or3cdY/IYGJ3D/7E50HgAh8oM/pQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026