UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HX/nyhYIvF3PzVZ17uXS7dQ75Cf2WL41YlSU0qHO/7w=' 
WHERE 
  key_id = '02182be02dcd941b0a0db0387bda02624629c4537d4fca3bcb2e4e53159fa69f' 
  AND (
    token = 'HX/nyhYIvF3PzVZ17uXS7dQ75Cf2WL41YlSU0qHO/7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041