UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IA0QWYdQLO/pSVpIEjni/98HHAfvKMrrNvxbIRpdf0w=' 
WHERE 
  key_id = 'c9a69600125253612ce7686b31a4647098f9363d47470477cf2aa23e03b7736e' 
  AND (
    token = 'IA0QWYdQLO/pSVpIEjni/98HHAfvKMrrNvxbIRpdf0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018