UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd/DWM9KYKpoxe0ig+wLIKha0StBVYz+p52W5Z5bCqvw='
WHERE
key_id = '0da5652b333866b18a285c271d29ecf8e9c1eaf57da605665e3d948030ccb4ea'
AND (
token = 'd/DWM9KYKpoxe0ig+wLIKha0StBVYz+p52W5Z5bCqvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)