UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zZ5L0JS/WJbPuK/t9hsR4zCHMAsgMOfcnolqFlgevI0='
WHERE
key_id = 'bdeb6f5ede15e98fa34cd4f12dc478edb4d2880f8fd7b3eaa03da99da40bf57a'
AND (
token = 'zZ5L0JS/WJbPuK/t9hsR4zCHMAsgMOfcnolqFlgevI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)