UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XC+E/PFZ6j5HymblUK1Ogq1luL6idpnLhGMIQhkCPpw=' 
WHERE 
  key_id = '629ac632d5af2bb1f31931e39e550435b94586d9c556724600b381b32b728c5b' 
  AND (
    token = 'XC+E/PFZ6j5HymblUK1Ogq1luL6idpnLhGMIQhkCPpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021