UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9OB0tpUZujVaK8e3EQL/xjktnNvYQsM4TSqWmVzRSFg='
WHERE
key_id = 'b403e42063b1fb600d11dd4fda3cbd221a50b22aa6c656a2f3f5bdc590a712df'
AND (
token = '9OB0tpUZujVaK8e3EQL/xjktnNvYQsM4TSqWmVzRSFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)