UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dlx9IpQsn76hQ3auM0zOxEps6d/5WFQxFkprxxeqQF4=' 
WHERE 
  key_id = 'ef6400278020bf105b0b90d5f5f3acb8f1ce2f4b324b9428a1b0ad32c9e8089f' 
  AND (
    token = 'Dlx9IpQsn76hQ3auM0zOxEps6d/5WFQxFkprxxeqQF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025