UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XdHFYVR6rYJqFoKU2fEYLJyoKH6kOvqkLPWyW3uGr2E='
WHERE
key_id = '5f72007b808d3357393ab7c72d7af89f0a44950ea55a8ebcc4ba5a4177698581'
AND (
token = 'XdHFYVR6rYJqFoKU2fEYLJyoKH6kOvqkLPWyW3uGr2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)