UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZrNT71qVis9GcagCW3EdIa5IFnSq6TxQyiaS22OoMhk='
WHERE
key_id = '6192b4ace78c565accbce1c14513ee0419bf85568bc76694722bb434c253e7e7'
AND (
token = 'ZrNT71qVis9GcagCW3EdIa5IFnSq6TxQyiaS22OoMhk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)