UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkgrQS5/q5QesoC6/lDG099YvURSxKn3DYBTOBOoP/g='
WHERE
key_id = '142dd417d4f70fb8ec38e73389a935bfb0d7e70fa06e05017d63109bcaadfc36'
AND (
token = 'kkgrQS5/q5QesoC6/lDG099YvURSxKn3DYBTOBOoP/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)