UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pp/TDp6TzSIo+ZQLxnIkLvy4dnQUPf53ao17Vb6E4DI='
WHERE
key_id = 'd029b4acf8d1719f844fcf09ac81f4abd67bc25c7697ea403ce51465934a06ea'
AND (
token = 'pp/TDp6TzSIo+ZQLxnIkLvy4dnQUPf53ao17Vb6E4DI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)