UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0G92vfsppEykaQhGG3LefldfYIiUcnxqg3NgOTgeo78=' 
WHERE 
  key_id = '58b3dd1105fcc9163886a78ebbaed73e1b588f97abd03217c8e20b9de84af66b' 
  AND (
    token = '0G92vfsppEykaQhGG3LefldfYIiUcnxqg3NgOTgeo78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037