UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LSK+DENCbgwoOEpLWlZXMavBA+50DMjsXtdF6K2X7QM='
WHERE
key_id = '4387f3fe9697f1fdb3ea0b77483307c0879e642666cb3ffab687973b6c8c5a39'
AND (
token = 'LSK+DENCbgwoOEpLWlZXMavBA+50DMjsXtdF6K2X7QM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)