UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KVeEpnV2RMkmaFe2g1pEhVPmV3vk1EU4yxXObpwxrQQ=' 
WHERE 
  key_id = '79a8c3b75e2a2301652468ede240173d9e56f350d2ad1761d78d71a0197ec254' 
  AND (
    token = 'KVeEpnV2RMkmaFe2g1pEhVPmV3vk1EU4yxXObpwxrQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045