UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WLhoKZPpFiIJM6PABzZZfo/EE5BP88c9nvG7RKcpzQI='
WHERE
key_id = '31b334a32b0a61a3a965ee3160a93d3a21232e3ad90df77b7153b4639b2f92c2'
AND (
token = 'WLhoKZPpFiIJM6PABzZZfo/EE5BP88c9nvG7RKcpzQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)