UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/LGod0gBzY17lLIBipMsw0fwc1Y//umtMK7oyctgYvg='
WHERE
key_id = 'b8941b6bac03c14c59e6a41ba8719312ebafcc1f17a81d56a77c829449ae2534'
AND (
token = '/LGod0gBzY17lLIBipMsw0fwc1Y//umtMK7oyctgYvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)