UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zl1H8wVo2TZeCdZSBtp2NZRJBRnheGaDejcDY8XYpVM=' 
WHERE 
  key_id = 'ff8034ace0a3aa4c63d5bb89bfb1f044b9cbeca2ae7842e7820ec2099af391f6' 
  AND (
    token = 'zl1H8wVo2TZeCdZSBtp2NZRJBRnheGaDejcDY8XYpVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030