UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SsiK8mwKw/eXkUcBMr49XZCHWXwLjyPjZPL5AM21PVs='
WHERE
key_id = '8cd2a6aade207de41976736da48fe95c4470660bebba0b8613941705eaedb899'
AND (
token = 'SsiK8mwKw/eXkUcBMr49XZCHWXwLjyPjZPL5AM21PVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)