UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NzkIkz/SIUdzMw2tzeZD1o+9ukoixBfWBlA/ZTe7w9c='
WHERE
key_id = 'b140d69e7648d683bce5681ef5d33575e1b08c59c3d11cbddd641f20387c42f8'
AND (
token = 'NzkIkz/SIUdzMw2tzeZD1o+9ukoixBfWBlA/ZTe7w9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)