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