UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sgLCo+Kcz7+pfc3eKF0Sh1fYu4zQtX2ncTz1YnKSVLY='
WHERE
key_id = 'aac8c8ba9ed76c7f0d8494e53240d949177aee2f520a55ef41605a333e00b6e1'
AND (
token = 'sgLCo+Kcz7+pfc3eKF0Sh1fYu4zQtX2ncTz1YnKSVLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)