UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AcX5odaNX9YLk/upjRUtVVOuK7QuPmD3N7MiMkhNGQM=' 
WHERE 
  key_id = '9321e8901962ee06327a9db0f472c37386f03216f457c3d84376e6230ec944df' 
  AND (
    token = 'AcX5odaNX9YLk/upjRUtVVOuK7QuPmD3N7MiMkhNGQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017