UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wvSiIhW87P1LA+T9MB9slN+XDlNOWQyEsyyY+TjV/m8='
WHERE
key_id = '5145b6d5ea38facb0282c0706bcdc046bf27118ce71ef5872bd8d0badd69a324'
AND (
token = 'wvSiIhW87P1LA+T9MB9slN+XDlNOWQyEsyyY+TjV/m8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)