UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EyW3o+LKa35d9vIai0YFJxC/i3/g1xaaNWW/W5Ux7H0=' 
WHERE 
  key_id = 'cac4d8a1cd78612455b8939fc0c109f40f7e4dd93751ace8e3bc52e984f8645d' 
  AND (
    token = 'EyW3o+LKa35d9vIai0YFJxC/i3/g1xaaNWW/W5Ux7H0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036