UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '55iE9kiFug8FOwlFoUPyw43iaK6oXaJqX0S3RerXsyA=' 
WHERE 
  key_id = '97281a569faf97d5672e0b18ce138ee1b528a950aaabf086957f7d3b45439682' 
  AND (
    token = '55iE9kiFug8FOwlFoUPyw43iaK6oXaJqX0S3RerXsyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039