UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NPUBDcjxM4xiujy7CZsZTyjWtI+jmF+NlHf4dQ1HFgM=' 
WHERE 
  key_id = '0156097fff5a064a765d08b3bc3d91f12c54114e94f998761ac0372c35c2e699' 
  AND (
    token = 'NPUBDcjxM4xiujy7CZsZTyjWtI+jmF+NlHf4dQ1HFgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076