UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ITsAHNDwOBerSgGnrlMTHREKL6qo/6hYYVn1TviimU4='
WHERE
key_id = 'df280d34e48b4bafe618aab0e7bb71dbf02dba30471945351953d975553ff2b0'
AND (
token = 'ITsAHNDwOBerSgGnrlMTHREKL6qo/6hYYVn1TviimU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)