UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnQIwjjOIxhjXV831Mk1cThPBjzNmYZvbxc/UycE24s='
WHERE
key_id = '96e23b7ef908115ff6dfdb723c65e738ce4ccc6e1d455cb3be45823bac275c7c'
AND (
token = 'HnQIwjjOIxhjXV831Mk1cThPBjzNmYZvbxc/UycE24s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)