UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q9PbIuJQZGGjp+IhKm3dAk1WgeCQ8Yrlk4OxjT0h48w=' 
WHERE 
  key_id = '61bcf5108eeb2f3dcaa1ab954ecb2060ec17f25db3403fb6731f1aeb05cc5901' 
  AND (
    token = 'q9PbIuJQZGGjp+IhKm3dAk1WgeCQ8Yrlk4OxjT0h48w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033