UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tR+Ma82eJfHdx7Eyr82SJw++UYxDzauZ2sLHWG8ogrw='
WHERE
key_id = 'e8dbaa570eff31ebaa3b5f56e8e5c334d307b4cfe39caf0e67a77c897906c9de'
AND (
token = 'tR+Ma82eJfHdx7Eyr82SJw++UYxDzauZ2sLHWG8ogrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)