UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QInOMB8hinI0hPVyZqOr7ny3O4OZPw7pKj1xuCEnoZU=' 
WHERE 
  key_id = 'c86dfc9a533431e77cbf7397cd96e8fff9916250247c5f3dced2a4ee1ed3d7f6' 
  AND (
    token = 'QInOMB8hinI0hPVyZqOr7ny3O4OZPw7pKj1xuCEnoZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043