UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ctUMSqYRVHP5UYOFrVWI8F/QZr08slvB8D6z9TTd5Is='
WHERE
key_id = 'e8921e3558c4eb2bf0828855bd763e3a18cea1cda1824df10bb86f25af142190'
AND (
token = 'ctUMSqYRVHP5UYOFrVWI8F/QZr08slvB8D6z9TTd5Is='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)