UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NbuzFg+bN8wQoYnLIb9su3NLwJDagyYgzfUjymk+Bho=' 
WHERE 
  key_id = '44ff187714f7c891e7b2a4d30ae9b72c7e67bdeacf5257175bfa7477feb9b086' 
  AND (
    token = 'NbuzFg+bN8wQoYnLIb9su3NLwJDagyYgzfUjymk+Bho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029