UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '951gMFakl6aqpyL2bDMsGpT/XG4Txmg+wCqN38kerpA=' 
WHERE 
  key_id = '5c15f7e26c2a246c38cc95aceed86324042867c6e01755f43957636ce5f6d82f' 
  AND (
    token = '951gMFakl6aqpyL2bDMsGpT/XG4Txmg+wCqN38kerpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042