UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LjLTUpEdzNeny9EuAtR2RSlKHt6JPgfAAdL+fok1KxU='
WHERE
key_id = '4d0a4068ec7d59d81e67f5f8f40aa96eddd23b972bf2fab60ee35a715b003a77'
AND (
token = 'LjLTUpEdzNeny9EuAtR2RSlKHt6JPgfAAdL+fok1KxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)