UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cn1qZPhLxfvfQhYG4KQ/LD+krIr7Pc6hCYa/sYeR3gk=' 
WHERE 
  key_id = '85709120f5e68b9d773cc93b0832fd7956e78586cf15325734ddc0c065fb5b90' 
  AND (
    token = 'cn1qZPhLxfvfQhYG4KQ/LD+krIr7Pc6hCYa/sYeR3gk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030