UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eLsrwkOn6P0B72zqMNaWSs1Tk1aUHdvV5QpKL4n95ME='
WHERE
key_id = '3b079c905a523274e4f5bc572e0f42ee83270592270a1e4eecb37440990d4960'
AND (
token = 'eLsrwkOn6P0B72zqMNaWSs1Tk1aUHdvV5QpKL4n95ME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)