UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W5OsZXvaOYegirA7pb/Hpu/CnRS2eYtibzxpbql/4BQ=' 
WHERE 
  key_id = 'e942a280470abfcf497400705aa2e19dfe3f67baa032877875402dda1e9c8b64' 
  AND (
    token = 'W5OsZXvaOYegirA7pb/Hpu/CnRS2eYtibzxpbql/4BQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036