UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQo6i8pvi9m07SO4iEY8VcdjsQn/LvIo+j/otgA41i0='
WHERE
key_id = '43a30ca47d2f90813d58a796460b2bda5c68e192a9fcc1bf0c407f8c2d13ad34'
AND (
token = 'kQo6i8pvi9m07SO4iEY8VcdjsQn/LvIo+j/otgA41i0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)