UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Yo388/LudCT4/1G3xFKKQhcs2zF6MXigas7mLclPUk='
WHERE
key_id = 'c77e3acee79733445f645b8d449283f6df18e90f24d2549ec0661d770bbd36d1'
AND (
token = '9Yo388/LudCT4/1G3xFKKQhcs2zF6MXigas7mLclPUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)