UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bs9W3iYeNWFBSvC71A8q1nCuc8P6dUSHEz5/JQ9J3v4='
WHERE
key_id = '4110dc8c40ce4d292dd11c6d0808f065c2e06fe685e9a29f6f847076c2ed94e0'
AND (
token = 'Bs9W3iYeNWFBSvC71A8q1nCuc8P6dUSHEz5/JQ9J3v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)