UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZTVOYYuDNZwwp1ex0mxYi81vx/3z4GEddG6I/OXPogA='
WHERE
key_id = '1f93e275ae5b8f0c3d0549bf6471ece2fbc527abe9ada3c8ab8325b16fdf622a'
AND (
token = 'ZTVOYYuDNZwwp1ex0mxYi81vx/3z4GEddG6I/OXPogA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)