UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yLYsqbPOBzDypnCIxgZ+IlXTvtn5QKogLGm+Xf76GxY=' 
WHERE 
  key_id = '86d76de4710bfa7663596f3b9f0073fd75b9140f28588c73480d501f56a7fce4' 
  AND (
    token = 'yLYsqbPOBzDypnCIxgZ+IlXTvtn5QKogLGm+Xf76GxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016