UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOLR5l7rZe8RcUIuPj0tn3CXK0vhnH9kxHW0l00M3j0='
WHERE
key_id = '3509bf51fc44674b61f3504f64468236874f4126c4c32c06f25e2c611ad4d192'
AND (
token = 'lOLR5l7rZe8RcUIuPj0tn3CXK0vhnH9kxHW0l00M3j0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)