UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49Yv9M1vUBOfL3Bv488n/NEpslBAE9rVZq1nE/e6BTs=' 
WHERE 
  key_id = 'fee71dd7ac94cbc109fbc12cd06619119212e6734ed575b4d98c4e95ec8b8b08' 
  AND (
    token = '49Yv9M1vUBOfL3Bv488n/NEpslBAE9rVZq1nE/e6BTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032