UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WiiPUjcXgR13+pInWAgMANRxex+Z3gzldoN40nGSo6E=' 
WHERE 
  key_id = 'ffc680bdd2bea273e2ec536eabb4160553210a9e318fc2fc6766e40fdee4e795' 
  AND (
    token = 'WiiPUjcXgR13+pInWAgMANRxex+Z3gzldoN40nGSo6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039