UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vu+z442H/CocB2pL+RhIpYgCW/jwBdVm2MhIR4wNjN4='
WHERE
key_id = '79ff24ec1194847ba944b33e0d6b7a228fb207019f68897f675978092a509e37'
AND (
token = 'Vu+z442H/CocB2pL+RhIpYgCW/jwBdVm2MhIR4wNjN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)