UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KHcofJiudYZ8lBIo1AadW9jqS/QRKXxgBF0TWYJPVAc='
WHERE
key_id = '24dd262b6babc38567b175a07c2bebd30ab3ba96acba9d986e0178ec26d37f25'
AND (
token = 'KHcofJiudYZ8lBIo1AadW9jqS/QRKXxgBF0TWYJPVAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)