UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'msv+soDupSDYtg+S4+pKPZ1xoGSuaIDZnI7LeLSVa0Y='
WHERE
key_id = 'df54b95aff64620a2513ea396dc15fce91da0763f99e73fcd17385fd9b987f1b'
AND (
token = 'msv+soDupSDYtg+S4+pKPZ1xoGSuaIDZnI7LeLSVa0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)