UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HzRV+81kfJDAgm53HJlJuYx2ItBWhXFahHOQlax6RRs=' 
WHERE 
  key_id = '72c413ca616b96f36e94f03589adf0ed5564b49a0a806d6d49eec279d893518f' 
  AND (
    token = 'HzRV+81kfJDAgm53HJlJuYx2ItBWhXFahHOQlax6RRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047