UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HfjJmZBA80xuZOCb5ZmaFBR/VgkpBsaQ4Zt6IofeOYs='
WHERE
key_id = 'daaca5b12e3eadc3ec33acf13ba1ec0dff2b50ad44d2ae7518434ae92e199fb1'
AND (
token = 'HfjJmZBA80xuZOCb5ZmaFBR/VgkpBsaQ4Zt6IofeOYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)