UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q5TGdGGOkUj1ZW6vYBDRaYww6xrrF+24peRhL6aNo08='
WHERE
key_id = '5aa02eae9535531dfdcaba887bba878aa5691fb38ee919896056052f971805de'
AND (
token = 'Q5TGdGGOkUj1ZW6vYBDRaYww6xrrF+24peRhL6aNo08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)