UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nHNSkdcMaH3O4zx9uz14VEnidYq6H9bVMWY167T+ji4='
WHERE
key_id = 'da3f38002a005beef8bfbc783510aaf7408c1357ce95273387a7fe639e24d6d9'
AND (
token = 'nHNSkdcMaH3O4zx9uz14VEnidYq6H9bVMWY167T+ji4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)