UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ZPQ79JDzyTUfI4AyvNwIAmRdum5wutH9SbVzwXokMI=' 
WHERE 
  key_id = '40d11cf27e74a75d8d872078f84909d4f3007f1a4ac0223eb9d619b06f2c0bae' 
  AND (
    token = '1ZPQ79JDzyTUfI4AyvNwIAmRdum5wutH9SbVzwXokMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041