UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vim8ppBq7lGRpNCpHidE9Yk7F4eyyd3hLaJC5qQHbSw=' 
WHERE 
  key_id = '43a729ee597c5f050c16f3d074cd54d989c34b4fa180e2a6c6e024ea2a8f5aae' 
  AND (
    token = 'Vim8ppBq7lGRpNCpHidE9Yk7F4eyyd3hLaJC5qQHbSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035