UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G/XzSzi2xoye7ydrpGH/TTnQ0MzjGh7kLSmBv8XH1wM='
WHERE
key_id = '1b1ec9a916b3ab1a25f47abb4ca0eddb94679f7a4ea0cfc1f4481a84be498d2f'
AND (
token = 'G/XzSzi2xoye7ydrpGH/TTnQ0MzjGh7kLSmBv8XH1wM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)