UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kpzJDNQPrfryIUOsOv/25Z8wEb4ypqJMPIRqR87ZhKE=' 
WHERE 
  key_id = '679341f6146131eeff32e338430f98ca2a8d2bc2cd33b881563e48e7c1955d97' 
  AND (
    token = 'kpzJDNQPrfryIUOsOv/25Z8wEb4ypqJMPIRqR87ZhKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032