UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N9Wf4yQQBMc4q1O+ZHHILIWWxl+r/o8M5Ug+WzERC10='
WHERE
key_id = '0987be40f5ecd5b9555aa79ef8a830478f510e9c64f3d110ed007630cdf5d967'
AND (
token = 'N9Wf4yQQBMc4q1O+ZHHILIWWxl+r/o8M5Ug+WzERC10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)