UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BM7Rt9/WpWZ+7pkuWFicfGfAXyVF9uZzPTW3JnzfyqM='
WHERE
key_id = '8c69e9a0cb2c072a904ce48a93f815b85310a8e5008d5bbe3c6a153c8f9bd8bd'
AND (
token = 'BM7Rt9/WpWZ+7pkuWFicfGfAXyVF9uZzPTW3JnzfyqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)