UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cDlH9I66vkoR9IOQRGHC+BLppMQcOAIdzXVic2OLU5E=' 
WHERE 
  key_id = '7396de3af3c92dd588f78864918631be7558ab6cd052e40717ae91b20feb5776' 
  AND (
    token = 'cDlH9I66vkoR9IOQRGHC+BLppMQcOAIdzXVic2OLU5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033